package com.bruce.demo2.patterns.demo2.structural.demo07.adapter.demo2;

/**
 * @PROJECT_NAME: design_patterns
 * @DESCRIPTION: 适配器类，把TF卡转换为SD卡
 * @AUTHOR: CNBruceLee
 * @DATE: 2021/7/22 21:42
 */
public class SDAdapterTF implements SDCard {

    private TFCard tfCard;

    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    public String readSD() {
        System.out.println("adapter read tf card");
        return tfCard.readTF();
    }

    public void writeSD(String data) {
        System.out.println("adapter write tf card");
        tfCard.writeTF(data);
    }
}
